﻿<Window x:Name="window" x:Class="Mido.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Mido="clr-namespace:Mido" xmlns:SettingsModule="clr-namespace:Mido.UiModules.SettingsModule"
        xmlns:ScrollBarModule="clr-namespace:Mido.UiModules.ScrollBarModule"
        xmlns:ActiveImageModule="clr-namespace:Mido.UiModules.ActiveImageModule"
        xmlns:Properties="clr-namespace:Mido.Properties"
        DataContext="{x:Static Mido:App.DomainViewModel}"
        ResizeMode="CanResizeWithGrip"
        WindowStyle="None"
        AllowsTransparency="True"
        Title="Mido" WindowStartupLocation="CenterScreen">
    
    
    <Border Margin="0,1,0,1" BorderBrush="{DynamicResource DefaultAppBrush}" BorderThickness="1" RenderTransformOrigin="0.5,0.5" Background="#FFF0F0F0">
        <Border.Effect>
            <DropShadowEffect Opacity="0.999" BlurRadius="16" ShadowDepth="0" />
        </Border.Effect>
        <DockPanel>
            <Grid DockPanel.Dock="Top" x:Name="LayoutRoot" MouseDown="DragableGridMouseDown" Background="{DynamicResource DefaultAppBrush}">
                <Grid x:Name="HeaderGrid" Height="25" VerticalAlignment="Top">
                    <Grid x:Name="DragableArea" MouseDown="DragableGridMouseDown"/>
                    <TextBlock x:Name="Minimize4Button" Text="Mido" Margin="10,0" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="16" Foreground="White" RenderTransformOrigin="0.5,0.5" />
                    <StackPanel Grid.Column="1" Orientation="Horizontal" Margin="0,1,5,0" HorizontalAlignment="Right" VerticalAlignment="Top" Background="{DynamicResource DefaultAppBrush}">
                        <ComboBox ItemsSource="{Binding AvailableLocalizations}" SelectedValuePath="Item2" DisplayMemberPath="Item1" SelectedValue="{Binding Localization}" Style="{StaticResource LocaizationComboBoxStyle}"/>
                        <Button Style="{DynamicResource SystemButton}" x:Name="MinimizeButton" Content="0" Click="MinimizeButton_Click" />
                        <Button Style="{DynamicResource SystemButton}" x:Name="MaximizeButton" Content="1" Click="MaximizeButton_Click" />
                        <Button Style="{DynamicResource SystemButton}" x:Name="CloseButton" Content="r" Click="CloseButton_Click" />
                    </StackPanel>
                </Grid>

                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
            </Grid>
            <Border DockPanel.Dock="Top" BorderBrush="#FFE5E5E5" BorderThickness="0,0,0,1">
            <Grid DockPanel.Dock="Top">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Button Grid.Column="0" Content="{x:Static Properties:Resources.MainWindow_Add_image}" Command="{Binding OpenImageCommand}" />
                <Button Grid.Column="1" Content="{x:Static Properties:Resources.MainWindow_Add_folder}" Command="{Binding OpenFolderCommand}" />
                <Button Grid.Column="2" Content="{x:Static Properties:Resources.MainWindow_Save}" Command="{Binding SaveCommand}"/>
                <Button Grid.Column="3" Content="{x:Static Properties:Resources.MainWindow_Feedback}" Command="{Binding FeedbackCommand}"/>
                <Button Grid.Column="4" Content="{x:Static Properties:Resources.AboutWindow_About}" Command="{Binding AboutCommand}"/>
                <Button Grid.Column="6" Content="{x:Static Properties:Resources.MainWindow_Settings}" Command="{Binding ShowHideSettingsCommand}" />
            </Grid>
            </Border>
            
            <Grid DockPanel.Dock="Top">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>

                <Grid Visibility="{Binding ShowImageViewers}">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    
                    <ActiveImageModule:ActiveImageView BorderBrush="#FFE5E5E5" BorderThickness="1" DataContext="{Binding ActiveImageViewModel}" Margin="5" />
                    <ScrollBarModule:ScrollBarView BorderBrush="#FFE5E5E5" BorderThickness="1" DataContext="{Binding ScrollBarViewModel}" Margin="5" Grid.Row="1"/>
                </Grid>

                <TextBlock Text="{x:Static Properties:Resources.MainWindow_Developed_by_Artem_Taradeiko_and_Andrey_Davidchyk}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Visibility="{Binding ShowDeveloperText}" Margin="5"/>
                <SettingsModule:SettingsView BorderBrush="#FFE5E5E5" BorderThickness="1" Margin="5" DataContext="{Binding SettingsViewModel}" Visibility="{Binding DataContext.PanelVisibility, ElementName=window}" Grid.Column="2" Grid.Row="0" Grid.RowSpan="2" DockPanel.Dock="Right" />
            </Grid>
            
        </DockPanel>
    </Border>
</Window>
